package com.LeeCode;

/**
 * 子串能表示从 1 到 N 数字的二进制串
 */

public class Code1016 {
    public static void main(String[] args) {
        String s = "0110";
        int n = 3;
        System.out.println(new Code1016().queryString(s, n));
    }

    public boolean queryString(String s, int n) {
        for (int i = 1; i <= n; i++) {
            if (!s.contains(Integer.toBinaryString(i))) {
                return false;
            }
        }
        return true;
    }
}
